import request from '@/utils/request'

/** *
 * 获取组织架构数据
 * **/
export function getDepartmentsApi() {
  return request({
    url: '/company/department'
  })
}

/**
 * 根据id删除部门
 * **/
export function delDepartmentsApi(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
// 新增部门
export function NewDepartmentAPI(obj) {
  return request({
    url: `/company/department`,
    method: 'POST',
    data: obj
  })
}

// 获取部门详情
export function DepartmentDetailsAPI(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 修改部门
export function ModifyTheDepartmentAPI(obj) {
  return request({
    url: `/company/department/${obj.id}`,
    method: 'PUT',
    data: obj
  })
}
